//
//  TTEstimateDetailMoneyView.m
//  TaoTuo
//
//  Created by LG on 2020/8/13.
//  Copyright © 2020 刘广. All rights reserved.
//

#import "TTEstimateDetailMoneyView.h"
#import "TTRecyclingMoneyHintView.h"
#import <UIView+TYAlertView.h>

@interface TTEstimateDetailMoneyView ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *moneyLabel;

@end

@implementation TTEstimateDetailMoneyView

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    self.layer.cornerRadius = 8;
    
    
}

- (void)setMoney:(NSString *)money
{
    if (money.length == 0) {
        return;
    }
    
    self.moneyLabel.font = [UIFont systemFontOfSize:30];
    self.moneyLabel.textColor = UIColorHex(#E72626);
    
    NSString *str = [NSString stringWithFormat:@"%@元", money];
    NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
    [attr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:18] range:[str rangeOfString:@"元"]];
    
    self.moneyLabel.attributedText = attr;
    
}

- (IBAction)clickWenhaoAction:(id)sender {
    
    TTRecyclingMoneyHintView *hintView = [TTRecyclingMoneyHintView createViewFromNib];
    hintView.frame = CGRectMake(0, 0, SCREEN_WIDTH - 120, 250);
    
    TYAlertController *alertVC = [TYAlertController alertControllerWithAlertView:hintView];
    alertVC.backgoundTapDismissEnable = YES;
    [[LLRouteTool getCurrentNavigationController] presentViewController:alertVC animated:YES completion:nil];
    
}

@end
